package com.bifrost.repository;

import com.bifrost.entity.SkuWarehouse;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * @author rangf
 * @date 2017/11/8
 */
@Deprecated
public interface SkuWarehouseRepository extends JpaRepository<SkuWarehouse, Long> {
    /**
     * 统计sku库存
     *
     * @param skuId
     * @return Long
     */
    @Query(value = "SELECT SUM(SW.QUANTITY) FROM SKU_WAREHOUSE SW WHERE SW.SKU_ID=?1", nativeQuery = true)
    Integer countSkuWarehouse(Long skuId);
}
